﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Admin_ReportDept.aspx.cs" Inherits="Xiaov.SmartWeb.Application.PluginSrc.StatisticalSystem.ReportDesign.Admin_ReportDept" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="/Resources/xiaovcn/scripts/usercheck.js"></script>
    <script>
        $(function () {
            bindgrid();
            $('#p').panel({height:userScreenHeight-35});
        });
        function callback(res) {
            if (res.value) {
                $.messager.alert('提示', '操作成功！');
            }
            else {
                $.messager.alert(res.error);
            }
        }
        function bindgrid() {           
            $('#tt').tree({                
                url: 'Json/BBBMB.aspx?dwbm=<%=DWBM%>',lines:true,
                checkbox:true,
            });            
        }

        function Save() {
            var nodes = $('#tt').tree('getChecked');
            var str = "";
            var dwbm='<%=DWBM%>';
            for (var i = 0; i < nodes.length; i++)
            {
                str += nodes[i].id+',';
            }
            //alert(str);
            Xiaov.SmartWeb.Application.PluginSrc.StatisticalSystem.ReportDesign.Admin_ReportDept.Save(str, dwbm, callback);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="padding-bottom: 5px;">
        <select class="easyui-combobox" id="dwbm" name="state" style="width: 200px;" data-options=" ">
        </select>
        <script type="text/javascript">
            var request_dwbm = '<%=DWBM%>';
            $(function () {
                $('#dwbm').combobox({ url: 'Json/DeptFilter.aspx', valueField: 'DWBM', textField: 'DWMC',
                    panelHeight: '200', formatter: formatItem,
                    onSelect: function (rec) { window.location.href('/PluginSrc/StatisticalSystem/ReportDesign/Admin_ReportDept.aspx?dwbm=' + rec.DWBM) },
                    onLoadSuccess: function (param) {
//                        alert(1);
                        $('#dwbm').combobox('setValue', request_dwbm);
                    }
                });
            });
            function formatItem(row) {
                var s = '<span style="color:#888">' + row.DWBM + '</span>-<span style="font-weight:bold">' + row.DWMC + '</span>';
                return s;
            }

            
        </script>
    </div>
    <div style="padding-top: 5px" class="easyui-panel" id="p" title="该单位有以下报表:" iconcls="icon-applicationgo">
        <ul id="tt">
        </ul>
    </div>
    <div style="padding-top: 5px">
        <a href="#" class="easyui-linkbutton" iconcls="icon-save" onclick="Save();">保存</a></div>
</asp:Content>
